import {mapGetters} from 'vuex'

export default {
  computed:{
    ...mapGetters('m_cart',['total'])
  },
  watch:{
    total(){
    this. setBadeg() 
    }
  },
  onShow(){
    this.setBadeg()
  },
  methods:{
    setBadeg(){
      uni.setTabBarBadge({
        index:2,
        text:this.total+'' //必须为字符串
      })
    }
  }
}
